#include<bits/stdc++.h>
using namespace std;
class Solution {
public:
    void moveZeroes(vector<int>& nums) {
        auto p1 = nums.begin();
        auto p2 = nums.begin();
        while (p2 != nums.end()) {
            if (*p2 != 0) {
                if (p1 != p2)
                    swap(*p1, *p2);
                p1++;
            }p2++;
        }
    }
};